You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > LinearSystems Class > LinearSystems Methods > Bilinear Method > LinearSystems.Bilinear Method ([In] TMtx, [In] TVec, [In] TVec, double, double)
Dew Signal for .NET
ContentsIndexHome
PreviousUpNext
LinearSystems.Bilinear Method ([In] TMtx, [In] TVec, [In] TVec, double, double)

Apply bilinear transform to a linear system represented in state-space form.

Syntax
C#
Visual Basic
public static void Bilinear([In] TMtx A, [In] TVec B, [In] TVec C, ref double D, double FS);

An analog lowpass filter is converted to z-domain by using the bilinear transform. The analog filter has a normalized cutoff frequency at 1 rad/sec. This frequency is mapped by the bilinear transformation to the value as returned by the function: BilinearUnwarp(1). To obtain the required cutoff frequency of an analog lowpass filter, which will map to a selected frequency in z-domain use the BilinearPrewarp routine.

using Dew.Math; using Dew.Math.Editors; using Dew.Math.Units; using Dew.Signal; using Dew.Signal.Units; using Dew.Math.Tee; using Dew.Signal.Tee; private void button1_Click(object sender, EventArgs e) { Vector z = new Vector(0); Vector p = new Vector(0); Vector num = new Vector(0); Vector den = new Vector(0); Vector Response = new Vector(0); Vector b = new Vector(0); Vector c = new Vector(0); double k,Wc,d; Matrix A = new Matrix(0,0); double FS = 2; int Order = 5; //design a fifth order filter. IIRFilters.EllipticAnalog(Order,0.2,40,z,p,out k); //design analog protype //passband ripple 0.2dB, stopband attenuation 40dB LinearSystems.Bilinear(z,p,ref k,FS,true); //Sampling frequency = 2 Wc = 0.6; //request a cutoff at 0.6 Hz LinearSystems.LowpassToLowpassZ(z,p,ref k,Wc, LinearSystems.BilinearUnwarp(1,FS)); //frequency transformation in z-domain LinearSystems.ZeroPoleToTransferFun(num,den,z,p,k); SignalUtils.FrequencyResponse(num, den, Response, 64, false, TSignalWindowType.wtRectangular, 0); //zero padding set to 64 MtxVecTee.DrawIt(Response, "Design method 0", false); //Alternative 1: IIRFilters.EllipticAnalog(Order,0.2,40,z,p,out k); //design analog protype LinearSystems.Bilinear(z,p,ref k,FS,true); //Sampling frequency = 2 LinearSystems.ZeroPoleToTransferFun(num,den,z,p,k); Wc = 0.6; //request a cutoff at 0.6 Hz LinearSystems.LowpassToLowpassZ(num,den,Wc,LinearSystems.BilinearUnwarp(1,FS)); //frequency transformation in z-domain SignalUtils.FrequencyResponse(num, den, Response, 64, false, TSignalWindowType.wtRectangular, 0); //zero padding set to 64 MtxVecTee.DrawIt(Response, "Design method 1", false); //Alternative 2: IIRFilters.EllipticAnalog(Order,0.2,40,z,p,out k); //design analog protype Wc = LinearSystems.BilinearPrewarp(0.6,FS); //request a cutoff at 0.6 Hz LinearSystems.LowpassToLowpass(z,p,ref k,Wc); //frequency transformation in s-domain LinearSystems.Bilinear(z,p,ref k, FS,true); //Sampling frequency = 2 LinearSystems.ZeroPoleToTransferFun(num,den,z,p,k); SignalUtils.FrequencyResponse(num, den, Response, 64, false, TSignalWindowType.wtRectangular, 0); //zero padding set to 64 MtxVecTee.DrawIt(Response, "Design method 2", false); //Alternative 3: IIRFilters.EllipticAnalog(Order,0.2,40,z,p,out k); //design analog protype LinearSystems.ZeroPoleToStateSpace(A,b,c,out d,z,p,k); Wc = LinearSystems.BilinearPrewarp(0.6,FS); //request a cutoff at 0.6 Hz LinearSystems.LowpassToLowpass(A,b,c,ref d,Wc); //frequency transformation in s-domain LinearSystems.Bilinear(A,b,c,ref d,2); LinearSystems.StateSpaceToZeroPole(z,p,out k,A,b,c,d); LinearSystems.ZeroPoleToTransferFun(num,den,z,p,k); SignalUtils.FrequencyResponse(num,den,Response,64,false,TSignalWindowType.wtRectangular,0); //zero padding set to 64 MtxVecTee.DrawIt(Response,"Design method 3",false); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!